private CodexThing _spawnPoint = new CodexThing(((Codex)this).GetClassThing());
private CodexThing _particles;
private int particlesGuid;
private boolean bStarted;
private boolean bSpawned;
public static String[] _params = new String[]{"Random Good 1 (template name)", "Random Good 2 (template name)", "Random Bad 1 (template name)", "Random Bad 2 (template name)"};
public void beginscene(int clientGuid, int captureID) {
if (!this.bSpawned) {
if (this.bStarted) {
this._particles = new CodexThing(this.particlesGuid);
} else {
this._particles = new CodexThing(this._spawnPoint.SpawnThing("mysticIdleMagic"));
this.particlesGuid = this._particles.GetGUID();
this.bStarted = true;
}
}
}
public void restore(int flags) {
this.bStarted = CodexSequence.RestoreBoolean();
this.bSpawned = CodexSequence.RestoreBoolean();
this.particlesGuid = CodexSequence.RestoreInt();
}
public MysticSpawner(String randomGood1, String randomGood2, String randomBad1, String randomBad2) {
this._randomGood1 = randomGood1;
this._randomGood2 = randomGood2;
this._randomBad1 = randomBad1;
this._randomBad2 = randomBad2;
}
void touched(int guid, int toucherGuid, int captureID) {
if (Codex.IsPlayerGuid(toucherGuid) && !this.bSpawned) {
this._particles.Remove();
int nRandom = (int)(Math.random() * (double)4.0F + (double)1.0F);
switch (nRandom) {
case 1:
this._spawnPoint.SpawnThing(this._randomGood1);
this._spawnPoint.SpawnThing("mysticGoodMagic");
break;
case 2:
this._spawnPoint.SpawnThing(this._randomGood2);
this._spawnPoint.SpawnThing("mysticGoodMagic");
break;
case 3:
this._spawnPoint.SpawnThing(this._randomBad1);
this._spawnPoint.SpawnThing("mysticBadMagic");
break;
case 4:
this._spawnPoint.SpawnThing(this._randomBad2);
this._spawnPoint.SpawnThing("mysticBadMagic");
}
new CodexSound("teleport_04.wav", 200.0F, 512.0F, 80, 0, 0, guid);